/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
  const { hasRoutes = [] }:any = initialState;
  return {
    RouteFilter: (route:any) => {
      // initialState 中包含了的路由才有权限访问
      return hasRoutes.includes(route.path)
    }, 
  };
}
